<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- v-model = v-on:input + v-bind:value -->
  <div id="app">
    <input type="text" :value='val' @input='handle'>
    <!-- @input 监听输入框内容的改变 v-bind:value 绑定value内容  -->
    <input type="text" :value='val' @input='val = $event.target.value'>
    <input type="text" v-model='val'>
    <div v-text='val'></div>
  </div>
  <script src="../vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        val: 'tom'
      },
      methods: {
        handle(e) {
          this.val = e.target.value
        }
      }
    })

  </script>
</body>

</html>